package com.suray.attendance.model.bean;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.suray.attendance.model.pojo.ProductionDataCollectDetailInfo;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * Description: 标准生产收集单
 * Author: linyu
 * Date: 2023/11/2
 */
@Data
@ApiModel(value = "ProductionDataCollectInfo")
public class ProductionDataCollectInfo  implements Serializable {
    private static final long serialVersionUID = 12L;
    private String collection_date; // 收集日期
    private String workstation_no; // 工作中心编号
    private String workstation_name; // 工作中心编号
    private String om_site_id; // 营运据点编号
    private String template_no;// 模版编号
    private String collect_times; // 收集次数
    private String employee_no; // 录入人员编号
    private String remark;
    private List<ProductionDataCollectDetailInfo> SF_DATA_COLLECT_D; // 传输的时候一定是 SF_DATA_COLLECT_D



    public String getCollection_date() {
        return collection_date;
    }

    public void setCollection_date(String collection_date) {
        this.collection_date = collection_date;
    }

    public String getWorkstation_no() {
        return workstation_no;
    }

    public void setWorkstation_no(String workstation_no) {
        this.workstation_no = workstation_no;
    }

    public String getOm_site_id() {
        return om_site_id;
    }

    public void setOm_site_id(String om_site_id) {
        this.om_site_id = om_site_id;
    }

    public String getTemplate_no() {
        return template_no;
    }

    public void setTemplate_no(String template_no) {
        this.template_no = template_no;
    }

    public String getCollect_times() {
        return collect_times;
    }

    public void setCollect_times(String collect_times) {
        this.collect_times = collect_times;
    }

    public String getEmployee_no() {
        return employee_no;
    }

    public void setEmployee_no(String employee_no) {
        this.employee_no = employee_no;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public List<ProductionDataCollectDetailInfo> getSF_DATA_COLLECT_D() {
        return SF_DATA_COLLECT_D;
    }

    public void setSF_DATA_COLLECT_D(List<ProductionDataCollectDetailInfo> SF_DATA_COLLECT_D) {
        this.SF_DATA_COLLECT_D = SF_DATA_COLLECT_D;
    }

    public String toDataString() {
        return "{" +
                "\"collection_date\":\"" + collection_date + '\"' +
                ",\"workstation_no\":\"" + workstation_no + '\"' +
                ",\"om_site_id\":\"" + om_site_id + '\"' +
                ",\"template_no\":\"" + template_no + '\"' +
                ",\"collect_times\":\"" + collect_times + '\"' +
                ",\"employee_no\":\"" + employee_no + '\"' +
                ",\"remark\":\"" + remark + '\"' +
                ",\"SF_DATA_COLLECT_D\":" + SF_DATA_COLLECT_D.toString() +
                '}';
    }

    public static String toJSONString(List<ProductionDataCollectInfo> productionDataCollectInfoList){
        if(productionDataCollectInfoList!=null&& productionDataCollectInfoList.size()>0){
            return JSONObject.toJSONString(productionDataCollectInfoList, SerializerFeature.DisableCircularReferenceDetect)
                    .replaceAll("sF_DATA_COLLECT_D", "SF_DATA_COLLECT_D");
        }
        return null;
    }

    public static String toJSONString(ProductionDataCollectInfo productionDataCollectInfo){
        if(productionDataCollectInfo!=null){
            return JSONObject.toJSONString(productionDataCollectInfo, SerializerFeature.DisableCircularReferenceDetect)
                    .replaceAll("sF_DATA_COLLECT_D", "SF_DATA_COLLECT_D");
        }
        return null;
    }
}
